<%@ Import Namespace="Microsoft.Web.Mvc" %>
<%@ Import Namespace="FlickrPortfolio.Helpers" %>
<%@ Import Namespace="FlickrPortfolio.Models"%>

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IList<Album>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Albums</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Albums</h2>
    
    <% foreach (var album in Model) { %>
        <div class="album" id="<%= album.ID %>">
            <img src="<%= album.DefaultPhoto.Urls.Where(x => x.UrlType == UrlType.Medium).First().Url %>" alt="<%= album.DefaultPhoto.Title %>" class="photo" />
            <a href="<%= Html.ActionLink(album.Title, "Show") %>"><%= album.Title %></a>
        </div>
    <% } %>

</asp:Content>
